<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小西瓜 <751707632@qq.com.com>
// +----------------------------------------------------------------------
namespace app\api\model;

use app\admin\model\RouteModel;
use think\Model;
use think\Db;

class SlideItemModel extends Model
{
	/**
	 * 获取banner列表
	 * @param 	int  $parent_id 父级ID
	 * 
	 */
	public function show($parent_id=0)
	{
		$where['status'] = 1;
		$where['slide_id'] = $parent_id;
		$banner = $this->where($where)->field('id, title, image, url')->order('list_order asc, id desc')->select()->toArray();
		foreach ( $banner as $key => $val ) {
			$banner[$key]['image'] = cmf_get_image_url(str_replace("\\","/",$val['image'])); // 处理图片
		}

		return $banner;
	}
}